var _n77;
var cc__extends = __extends;
var cc__decorate = __decorate;
var cc__spreadArrays = __spreadArrays;
var cc__importDefault = __importDefault;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var $1$userService = require("userService");
var c = cc__importDefault($1$userService);
var $1$zqcc_OverallSystem = require("zqcc_OverallSystem");
var l = cc__importDefault($1$zqcc_OverallSystem);
cc.macro.CLEANUP_IMAGE_CACHE = false;
cc.dynamicAtlasManager.enabled = true;
cc.dynamicAtlasManager.maxFrameSize = 512;
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
cc__decorator.property;
cc.macro.ENABLE_WEBGL_ANTIALIAS = true;
cc.macro.ENABLE_MULTI_TOUCH = false;
var def_start = function (t) {
  function _ctor() {
    return null !== t && t.apply(this, arguments) || this;
  }
  cc__extends(_ctor, t);
  _ctor.prototype.onLoad = function () {
    l.default.Initialize(); // 初始化模块

    let uiRoot = this.node.parent.getChildByName("UIRoot"); // 获取名为 "UIRoot" 的节点
    cc.game.addPersistRootNode(uiRoot); // 将该节点添加为持久化根节点
    l.default.Servers.uiSrv._setUIRoot(uiRoot); // 设置UI根节点

    let aspectRatio = cc.winSize.width / cc.winSize.height; // 计算宽高比
    c.default.IPAD = true; // 默认设为iPad
    c.default.daren = false; // 设置daren为false

    // 根据宽高比判断是否为iPad
    if (aspectRatio < 750 / 1334) {
      c.default.IPAD = false; // 如果宽高比小于特定值，设为非iPad
    }

    console.log("winSize:", cc.winSize); // 打印窗口大小
  };
  _ctor.prototype.start = function () {
    this.onReady();
  };
  _ctor.prototype.onReady = function () {
    this.initEngineConfig();
    this.printEngineConfig();
    this.goToLoading();
  };
  _ctor.prototype.initEngineConfig = function () {
    l.default.Managers.gameMgr.openPhysics(true, true);
    l.default.Managers.gameMgr.openCollision(true);
    l.default.Managers.gameMgr.openPhysicsDebugDrawFlags(false);
    l.default.Managers.gameMgr.openCollisionDebugDraw(false);
    l.default.Managers.gameMgr.openDebugFPS(false);
  };
  _ctor.prototype.printEngineConfig = function () {
    console.log("cocos引擎配置");
    console.log("是否开启抗锯齿", cc.view.isAntiAliasEnabled(), cc.macro.ENABLE_WEBGL_ANTIALIAS);
    console.log("是否开启多点触摸", cc.macro.ENABLE_MULTI_TOUCH);
    console.log("是否显示左下角调试信息", cc.debug.isDisplayStats());
    console.log("是否开启瓦片地图的自动裁减功能", cc.macro.ENABLE_TILEDMAP_CULLING);
    console.log("单次批处理渲染的顶点数量", cc.macro.BATCH_VERTEX_COUNT);
    console.log("Canvas背景是否支持 alpha 通道", cc.macro.ENABLE_TRANSPARENT_CANVAS);
    console.log.apply(console, cc__spreadArrays(["引擎支持的图片格式"], cc.macro.SUPPORT_TEXTURE_FORMATS));
  };
  _ctor.prototype.goToLoading = function () {
    l.default.loadScene("loading");
  };
  return cc__decorate([ccp_ccclass], _ctor);
}(cc.Component);
exports.default = def_start;